package com.threeti.mecool.web.form;

import com.threeti.mecool.core.domain.model.project.ProjectCategory;
import com.threeti.mecool.framework.util.Lists;
import com.threeti.mecool.framework.web.form.AbstractSearchCriteriaForm;
import com.threeti.mecool.legacy.domain.model.basicdata.biz.PosLegacy;
import org.apache.commons.lang.StringUtils;

import java.util.List;

public class ChannelInfoForm extends AbstractSearchCriteriaForm {
    public static final String TYPE_UPDATE_CHANNEL = PosLegacy.ENABLE;
    public static final String TYPE_DISABLE_CHANNEL = PosLegacy.DISABLE;

    private String changeTypeSlt;
    private String finishedAt;
    private String storeChannelName;
    private String empName;
    private String projectName;
    private String projectCode;
    private String finishedAtFrom;
    private String finishedAtTo;

    private String projectCategoryIdSlt;

    private List<ProjectCategory> projectCategories = Lists.newArrayList();

    private String dataTypeCode;
    private String dataToBeChanged;
    private String updateType = TYPE_UPDATE_CHANNEL;
    private Long userStepResultId;
    private Double latitude;
    private Double longitude;

    public String getChangeTypeSlt() {
        return changeTypeSlt;
    }

    public void setChangeTypeSlt(String changeTypeSlt) {
        this.changeTypeSlt = changeTypeSlt;
    }

    public String getFinishedAt() {
        return finishedAt;
    }

    public void setFinishedAt(String finishedAt) {
        this.finishedAt = finishedAt;
    }

    public String getStoreChannelName() {
        return storeChannelName;
    }

    public void setStoreChannelName(String storeChannelName) {
        this.storeChannelName = storeChannelName;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getProjectCategoryIdSlt() {
        return projectCategoryIdSlt;
    }

    public void setProjectCategoryIdSlt(String projectCategoryIdSlt) {
        this.projectCategoryIdSlt = projectCategoryIdSlt;
    }

    public List<ProjectCategory> getProjectCategories() {
        return projectCategories;
    }

    public void setProjectCategories(List<ProjectCategory> projectCategories) {
        this.projectCategories = projectCategories;
    }

    public String getDataTypeCode() {
        return dataTypeCode;
    }

    public void setDataTypeCode(String dataTypeCode) {
        this.dataTypeCode = dataTypeCode;
    }

    public String getDataToBeChanged() {
        return dataToBeChanged;
    }

    public void setDataToBeChanged(String dataToBeChanged) {
        this.dataToBeChanged = dataToBeChanged;
    }

    public String getUpdateType() {
        return updateType;
    }

    public void setUpdateType(String updateType) {
        this.updateType = updateType;
    }

    public String getFinishedAtFrom() {
        return finishedAtFrom;
    }

    public void setFinishedAtFrom(String finishedAtFrom) {
        this.finishedAtFrom = finishedAtFrom;
    }

    public String getFinishedAtTo() {
        return finishedAtTo;
    }

    public void setFinishedAtTo(String finishedAtTo) {
        this.finishedAtTo = finishedAtTo;
    }

    public Long getUserStepResultId() {
        return userStepResultId;
    }

    public void setUserStepResultId(Long userStepResultId) {
        this.userStepResultId = userStepResultId;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    @Override
    public boolean hasAnyConditionInputed() {
        return StringUtils.isNotBlank(changeTypeSlt) || StringUtils.isNotBlank(empName)
                || StringUtils.isNotBlank(storeChannelName) || StringUtils.isNotBlank(projectName) || StringUtils.isNotBlank(projectCode)
                || StringUtils.isNotBlank(projectCategoryIdSlt) || StringUtils.isNotBlank(finishedAtFrom) || StringUtils.isNotBlank(finishedAtTo);
    }

}
